from clutch.topes.defaults import *

def config_model(cfg):
    sections = []
    for sect in cfg.sections():
        settings = [ m.StringTope(name) for name,value in cfg.items(sect) ]
        sections.append(m.TopeGroup(sect, *settings))
    return m.TopeGroup('config', *sections)

def config_dict(cfg):
    sections = {}
    for sect in cfg.sections():
        sections[sect] = dict(cfg.items(sect))
    return sections
    
